using UnityEngine;
using System.Collections;

public class BallSpeed : MonoBehaviour {

	public float minimalSpeed = 20;
	// Use this for initialization
	void Start () {
	
	}
	
	void FixedUpdate()
	{

		if(gameObject.rigidbody.velocity.magnitude< minimalSpeed)
		{
			if(gameObject.rigidbody.velocity.magnitude != 0)
				gameObject.rigidbody.velocity = gameObject.rigidbody.velocity/gameObject.rigidbody.velocity.magnitude;
			gameObject.rigidbody.velocity = gameObject.rigidbody.velocity*minimalSpeed;
		}
		
		
		
		//gameObject.rigidbody.velocity = new Vector3(0,1,0);
	}
}
